package org.javascud.extensions.zookeeper;

import org.apache.zookeeper.ZooKeeper;

/**
 * To do description.
 *
 * @author: Felix Zhang  Date: 2010-9-30 16:08:08
 */
public class PropertyCenterTester
{
    public static void main(String[] args) throws Exception
    {
        String address = "127.0.0.1:2181";
        ZooKeeper zk = new ZooKeeper(address, 3000, null);

        PropertyCenter pcenter  = new PropertyCenter();
        pcenter.setZooKeeper(zk);
        pcenter.setCharset("GBK");

        pcenter.createRootNode("database"); //if not create before
        pcenter.setRoot("database");

        String name = "url";

        pcenter.updateProperty(name, "127.0.0.1");
        pcenter.updateProperty(name, "128.0.0.1");

        System.out.println(pcenter.getStringProperty(name));

        //get properties once

        //get all child properties once
        

        

    }
}
